/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package BeanRequest;

import Dao.DaoExperiencia;
import Pohos.Experiencia;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Duvan11
 */
@ManagedBean
@RequestScoped
public class MBRExperiencia {

    private Experiencia experiencia;
    private List<Experiencia>exp;

    
    public MBRExperiencia() {
        this.experiencia = new Experiencia();
    }
    
    public String register() throws Exception{
       DaoExperiencia daoexperiencia = new DaoExperiencia();
       daoexperiencia.register(this.experiencia);
       return "Menu";
    }
    
    public List<Experiencia> getMostrar() throws Exception{
       DaoExperiencia daoexperiencia = new DaoExperiencia();
       exp =  daoexperiencia.ver();
       return  exp;
    }
    
    public void update(){
       DaoExperiencia daoexperiencia = new DaoExperiencia();
       daoexperiencia.update(this.experiencia);
       experiencia = new Experiencia();    
    }
    public Experiencia getExperiencia() {
        return experiencia;
    }

    public void setExperiencia(Experiencia experiencia) {
        this.experiencia = experiencia;
    } 
    
    public List<Experiencia> getExp() {
        return exp;
    }

    public void setExp(List<Experiencia> exp) {
        this.exp = exp;
    }
}
